package com.prime.tutorial.moviestore.dao;


import com.prime.tutorial.moviestore.domain.PortType;
import org.springframework.stereotype.Repository;

import javax.persistence.Query;
import java.util.List;

@Repository
public class PortTypeDAOWithJPA extends GenericDAOWithJPA<PortType, Long> implements PortTypeDAO {

    //	@SuppressWarnings("unchecked")
    public List<PortType> findByType(String name) {
        Query query = entityManager.createQuery("Select distinct m from PortType m where m.type = ?1");
        query.setParameter(1, name);
        return query.getResultList();
//		return getJpaTemplate().find("Select m from Groups m where m.name = ?1",name);
    }

}